package com.itawei.polymorphism;

public class Test {
    public static void main(String[] args) {
//    Person p1 = new Person("老王", 30);
//    Dog d = new Dog("黑",2);
//    p1.keepPet(d,"大黄屎");
//
//    Person p2 = new Person("老李", 25);
//    Cat c = new Cat("灰",3);
//    p2.keepPet(c,"鱼");

        Person p = new Person("小王", 18);
        Animal d = new Dog("黑",2);
        Animal c = new Cat("灰",3);
        p.keepPet(d,"大黄屎");
        p.keepPet(c,"鱼");


    }
}
